package ch5;

import util.Debug;

/**
 * 线程中断标记不能作为线程停止标记的demo
 */

public class MayNotBeTerminatedDemo {

    public static void main(String[] args) throws InterruptedException {
        TaskRunner tr = new TaskRunner();
        tr.init();
        tr.submit(new Runnable() {
            @Override
            public void run() {
                Debug.info("before doing task");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {

                }
                Debug.info("after doing task");
            }
        });
        tr.workerThread.interrupt();
    }
}
